package com.qingmeng.apiclientsdk.service;

import cn.hutool.http.HttpResponse;
import com.qingmeng.apiclientsdk.client.ApiClient;
import com.qingmeng.apiclientsdk.exception.ApiException;
import com.qingmeng.apiclientsdk.model.Request.BaseRequest;
import com.qingmeng.apiclientsdk.model.Request.HistoryDayRequest;
import com.qingmeng.apiclientsdk.model.Request.NameRequest;
import com.qingmeng.apiclientsdk.model.Response.HistoryDayResponse;
import com.qingmeng.apiclientsdk.model.Response.NameResponse;
import com.qingmeng.apiclientsdk.model.Response.ResultResponse;

/**
 * @Author: WPF
 * @DateTime: 2025/01/02 17:56
 * @Version: 1.0
 * @Description:
 */
public interface ApiService {
    /**
     * 通用请求
     *
     * @param request 要求
     * @return {@link HttpResponse}
     * @throws ApiException 业务异常
     */
    <O, T extends ResultResponse> T request(BaseRequest<O, T> request) throws ApiException;

    /**
     * 通用请求
     *
     * @param apiClient qi api客户端
     * @param request     要求
     * @return {@link T}
     * @throws ApiException 业务异常
     */
    <O, T extends ResultResponse> T request(ApiClient apiClient, BaseRequest<O, T> request) throws ApiException;

    NameResponse getNameByJson(NameRequest nameRequest) throws ApiException;
    NameResponse getNameByJson(NameRequest nameRequest, ApiClient apiClient) throws ApiException;
    HistoryDayResponse getHistoryDayByJson(HistoryDayRequest historyDayRequest) throws ApiException;
    HistoryDayResponse getHistoryDayByJson(HistoryDayRequest historyDayRequest, ApiClient apiClient) throws ApiException;

}
